package com.jiaeda.shiromaster.mapper;

import com.jiaeda.shiromaster.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * Created by chengchaopeng on 2018/6/27.
 */
@Mapper
@Component
public interface SysUserMapper {

    @Select("select  user_id as userId,login_account as loginAccount,login_pass as loginPass," +
            "user_name as userName,user_head as userHead,user_phone as userPhone," +
            "user_email as userEmail,user_sex as userSex,user_birthday as userBirthday," +
            "DATE_FORMAT(register_time, '%Y-%m-%d %T') as registerTime ,department_key as departmentKey " +
            "from sys_user where login_account=#{loginAccount}")
    SysUser findByLoginAccount(@Param("loginAccount") String loginAccount);
}


